<script setup>
const props = defineProps({
    car: String,
    money: Number
})

console.log(props.car);
console.log(props.money);

const emit = defineEmits(['changeMoney'])
const buy = () => {
    emit('changeMoney', 5)
}

</script>

<template>
    <div class="son">子组件 - {{ car }} - {{ money }}</div>
    <button @click="buy">购买</button>
</template>

<style scoped>
    .son{
        color: red;
    }
</style>